#include <stdio.h>
#include <string.h>

#define OFFSET ('a'-'A')

int main(int argc, char **argv)
{
	char in1[100], in2[100], out[100];
	char c;
	
	int mark[255] = {0};
	int i, j, k;

	scanf("%s%s", in1, in2);

	for(i=0, j=0, k=0; in1[i] != 0; i++)
	{
		if(in1[i] == in2[j])
		{
			j++;
		}
		else
		{
			c = in1[i];

			if(c >= 'a' && c <= 'z')
				c -= OFFSET;

			out[k++] = c;
		}
	}

	for(i = 0; i < k; i++)
	{
		c = out[i];

		if(mark[c] == 0)
		{
			printf("%c", c);
			mark[c] = 1;
		}
	}
	printf("\n");
	return 0;
}